<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="./css/quick_layout.css"/>
    <script src="./js/jquery.js"></script>
</head>
<body>
<div class="tc">
    通过pushState改变hash：
</div>
<div class="tc mt10 mb10">
    <button type="button" onclick="pushState({},'#1');">pushState({},'#1')</button>
    <button type="button" onclick="replaceState({},'#2');">replaceState({},'#2')</button>
</div>
<div id="log" class="tc">

</div>
<script>
    function pushState(state, page) {
        history.pushState(state, '', page);
    }

    function replaceState(state, page) {
        history.replaceState(state, '', page);
    }

    window.onhashchange = function(event){
        $('#log').html('当前网页的hash：' + location.hash);
    }
</script>
</body>
</html>